<?php
	include_once('function/func.php');
?>
<script type="text/javascript" src="<?=PATH_URL.'static/js/admin/jquery.slugit.js'?>"></script>
<div class="gr_perm_error" style="display:none;">
	<p><strong>FAILURE: </strong><span id="txt_error">Permission Denied.</span></p>
</div>
<div class="table">
	<div class="head_table"><div class="head_title_edit"><?=$this->session->userdata('Name_Module')?></div></div>
	<div class="clearAll"></div>

	<form id="frmManagement" action="<?=PATH_URL.'admincp/'.$module.'/save/'?>" method="post" enctype="multipart/form-data">
	<input type="hidden" value="<?=$id?>" name="hiddenIdAdmincp" />
    <input type="hidden" value="<?=rand_string(4)?>" name="numberAdmincp" />

	<div class="row_text_field_first">
		<table cellspacing="0" cellpadding="0" border="0" width="100%">
			<tr>
				<td class="left_text_field">Mã hóa đơn:</td>
				<td class="right_text_field"><input value="<?php if(isset($result->maHD)) { print $result->maHD; }else{ print '';} ?>" type="text" name="" id="" /></td>
			</tr>
		</table>
	</div>
    
    <div class="row_text_field">
		<table cellspacing="0" cellpadding="0" border="0" width="100%">
			<tr>
				<td class="left_text_field">Tên khách hàng:</td>
				<td class="right_text_field"><input value="<?php if(isset($result->name)) { print $result->name; }else{ print '';} ?>" type="text" name="" id="" /></td>
			</tr>
		</table>
	</div>
    
    <div class="row_text_field">
		<table cellspacing="0" cellpadding="0" border="0" width="100%">
			<tr>
				<td class="left_text_field">Số điện thoại:</td>
				<td class="right_text_field"><input value="<?php if(isset($result->phone)) { print '0'.$result->phone; }else{ print '';} ?>" type="text" name="" id="" /></td>
			</tr>
		</table>
	</div>
    
    <div class="row_text_field">
		<table cellspacing="0" cellpadding="0" border="0" width="100%">
			<tr>
				<td class="left_text_field">Số sản phẩm:</td>
				<td class="right_text_field"><input value="<?php print $sp[0]->sp; ?>" type="text" name="" id="" /></td>
			</tr>
		</table>
	</div>
    
    <div class="row_text_field">
		<table cellspacing="0" cellpadding="0" border="0" width="100%">
			<tr>
				<td class="left_text_field">Giá:</td>
				<td class="right_text_field"><input value="<?php print $price[0]->tong; ?>" type="text" name="" id="" /></td>
			</tr>
		</table>
	</div>
	
	<div class="row_text_field">
		<table cellspacing="0" cellpadding="0" border="0" width="100%">
			<tr>
				<td class="left_text_field">Địa chỉ:</td>
				<td class="right_text_field"><input value="<?php if(isset($result->address)) { print $result->address; }else{ print '';} ?>" type="text" name="priceOldAdmincp" id="priceOldAdmincp" /></td>
			</tr>
		</table>
	</div>
    
    <div class="row_text_field">
		<table cellspacing="0" cellpadding="0" border="0" width="100%">
			<tr>
				<td class="left_text_field">Lời nhắn:</td>
				<td class="right_text_field"><textarea><?php if(isset($result->note)) { print $result->note; }else{ print '';} ?></textarea></td>
			</tr>
		</table>
	</div>
    
    <div class="row_text_field">
		<table cellspacing="0" cellpadding="0" border="0" width="100%">
			<tr>
				<td class="left_text_field">Chi tiết từng sản phẩm:</td>
				<td class="right_text_field" style="padding-right: 0">
                	<div class="content_table">
                	<table cellspacing="0" cellpadding="0" border="0" width="100%" class="table_sub">
                    	<tr>
                        	<th class="td_center" width="120">Hình</th>
                            <th class="td_left">Tên sản phẩm</th>
                            <th class="td_center" width="120">Giá</th>
                            <th width="130"></th>
                        </tr>
                        <?php
							if($arrayIdProduct){
								foreach($arrayIdProduct as $r){
									$arrayPro=$this->productsModel->getOneIdProduct($r->idProduct);
									foreach($arrayPro as $row){								
						?>
                        <tr>
                        	<td class="td_center"><img class="img_block" alt="" src="<?=resizeImage(PATH_URL.IMAGES_PRODUCTS.$row->image,120)?>" /></td>
                            <td class="th_left"><?=$row->title?></td>
                            <td class="td_center">
                                <?php if($row->price_new != 0 && $row->promotion != 0){?>
									<?=number_format($row->price_new,0,',','.');?> vnđ
                                <?php }else{?>
                                    <?=number_format($row->price_old,0,',','.');?> vnđ
                                <?php }?>
                            </td>
                            <td class="td_center">
                                <?php if($row->price_new != 0 && $row->promotion != 0){?>
									Hàng giảm giá
                                <?php }else{?>
                                    Hàng ko giảm giá
                                <?php }?>
                            </td>
                        </tr>
                        <?php }}}?>
                    </table>
                    </div>
                </td>
			</tr>
		</table>
	</div>
    
   
	</form>
</div>